import {init} from "snabbdom/src/package/init";
import {h} from "snabbdom/src/package/h";
import {styleModule} from 'snabbdom/src/package/modules/style'
import {eventListenersModule} from 'snabbdom/src/package/modules/eventlisteners'

let patch = init([
    styleModule, eventListenersModule
])

let vnode = h('div', {
    style: {
        backgroundColor: 'red'
    },
    on: {
        click: eventHandler
    }
}, [
    h('h1', 'Hello Snabbdom'),
    h('p', '1999')
])

function eventHandler() {
    console.log('clicked me')
}

let app = document.querySelector('#app')

patch(app, vnode)